using System;
using System.Threading;

namespace ebcbauteile
{
    public class Synchronizer<T>
    {
        private readonly SynchronizationContext synchronizationContext;

        public Synchronizer() {
            synchronizationContext = SynchronizationContext.Current ?? new SynchronizationContext();
        }

        public void In_Event(T t) {
            synchronizationContext.Send(state => Out_Event(t), null);
        }

        public event Action<T> Out_Event;
    }
}